<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\AppRelease;
class UpdateController extends Controller
{
    public  function index(Request $request) {
        $v=$request->get('v');
        $one= AppRelease::where('is_default',1)->first();
        if($one&&$one->v>$v){
           // info($v.'1---'.$one->v.'===');
            return json_encode(['code'=>0,'date'=>$one]);
        }
          // info($v.'2---'.$one->v.'===');
        return json_encode(['code'=>1,'date'=>[]]);
    }
}
